//
//  BHTabbarController.swift
//  BigHealth
//
//  Created by 蔺百好 on 2021/6/1.
//

import UIKit

class BHTabbarController: UITabBarController {

    override func viewDidLoad() {
        super.viewDidLoad()

        // 解决13系统之后push返回tabbar的标题文字变蓝问题
        if #available(iOS 13.0, *) {
            self.tabBar.tintColor = UIColor.color_34CE98
            self.tabBar.unselectedItemTintColor = UIColor.color_97949E
        }
        self.tabBar.barTintColor = .white
        
        self.configTabbarVCs()
       
    }
    

    func configTabbarVCs() {
        let homeVC = BHHomeViewController.init()
        let circleVC = BHCircleMainViewController.init()
        let myCenter = BHMeMainViewController.init()
        
        
        let homeNav = BHNavigationController.init(rootViewController: homeVC)
        let circleNav = BHNavigationController.init(rootViewController: circleVC)
        let myCenterNav = BHNavigationController.init(rootViewController: myCenter)

        homeNav.build("首页", "bh_tabbar_home_normal", "bh_tabbar_home_select")
        circleNav.build("圈子", "bh_tabbar_circle_normal", "bh_tabbar_circle_select")
        myCenterNav.build("我的", "bh_tabbar_me_normal", "bh_tabbar_me_select")
        
        self.viewControllers = [homeNav,circleNav,myCenterNav]
    }

}
